package com.kbt.global.data;

import com.kbt.model.data.UserAddressInfoModel;

import java.util.ArrayList;
import java.util.List;

/**
 * 全局静态实例数据
 */
public class ApplicationData {

    //要结算的订单信息
    public static List<Object> submitList = new ArrayList<Object>();

    //购物车中的数据
    public static List<Object> carItemList = new ArrayList<Object>();
    //

    public static List<UserAddressInfoModel> addressInfoModels = new ArrayList<UserAddressInfoModel>();

    //更新数据状态
    public static void updateAddressInfoModels(UserAddressInfoModel userInfo) {
        UserAddressInfoModel temp;
        for (int i = 0; i < addressInfoModels.size(); i++) {
            temp = addressInfoModels.get(i);
            if (temp.getAddressId().equals(userInfo.getAddressId())) {
                temp.setIsDeafultAddress(true);
            } else {
                temp.setIsDeafultAddress(false);
            }
        }
    }
}
